<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcss.com/angular.js/1.6.4/angular.min.js"></script>

</head>
<body>
     <div ng-app="myApp">
         <!--作为标签-->
         <my-directive></my-directive>
         <!--作为class名字-->
         <div class="my-directive"></div>
         <!--作为属性-->
         <div my-directive></div>
     </div>
</body>
<script>
    //angular对象初始化
    var app = angular.module("myApp",[]);

    //自定义指令
    app.directive("myDirective",function () {
        return {
            ////EAC element:可以当标签   attibute:可以当做属性   class:可以当做class名字
            restrict:'EAC',
//            template:'<h1>我就是被渲染的内容</h1>'

            templateUrl:'page1.html'
        }
    });

//    (function a() {
//        console.log(45+5);
//    })();
</script>
</html>